#!/bin/bash


read -p  "`basename $0` script will create a \"auto\" directory, and download files to it. [yes/no]: " acc

if [ "$acc". == "yes". ] ; then

        HTTP=http://op2ls.googlecode.com/svn/trunk

        if [ -e ./auto/auto_op2ls ]; then
		ls --color -l ./auto/ 
                echo ./auto/auto_op2ls files exist.
        else
                svn co $HTTP/auto ./auto
                echo files has been downloaded.
        fi
        read -p "run ./auto/auto_op2ls to build op2ls. [yes/no]: " run

        if [ "$run". == "yes". ] ; then
		pushd `pwd`

                cd ./auto
                ./auto_op2ls

		popd

        else
                echo Abort auto_op2ls build script.
        fi
else
        echo Abort op2ls download.
fi

